package cn.tedu.work;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class GuanYu {

    private String name="关二爷";
    @Autowired
    @Qualifier("dragonBlade")
    private Weapon weapon;

    @Autowired
    @Qualifier("redRabbit")
    private Mount mount;

    public void fight(){
        System.out.println(name+"骑着"
                +mount.getName()+"使用"+weapon.getName()+"战斗");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    public Mount getMount() {
        return mount;
    }

    public void setMount(Mount mount) {
        this.mount = mount;
    }
}
